<!DOCTYPE html>
<html lang="zh-CN">

<#assign html_title="搬砖之家">
        <head>

                <#include "/components/head.htm"   />
        </head>
        <body>
        <div id="fullPage">
                <!--Page One-->
                <#include "/components/header.section.htm"   />
                <section>
                        <div class="container white-block">
                                <h3>订单预览</h3>

                                <h4>基本信息</h4>
                                <div class="row"> <div class="col-md-1"></div><div class="col-md-3">创建时间</div><div class="col-md-3">${.now?string("yyyy-MM-dd HH:mm:ss")}</div> </div>
                                <div class="row"> <div class="col-md-1"></div><div class="col-md-3">套餐名称</div><div class="col-md-3">${combo.name}</div> </div>
                                <div class="row"> <div class="col-md-1"></div><div class="col-md-3">套餐单价</div><div class="col-md-3">${combo.price?string('0.00')} 元</div> </div>
                                <div class="row"> <div class="col-md-1"></div><div class="col-md-3">套餐天数</div><div class="col-md-3">${combo.day}</div> </div>
                                <div class="row"> <div class="col-md-1"></div><div class="col-md-3">总金额</div><div class="col-md-3">${combo.amount?string('0.00')} 元</div> </div>
                                <h4>订阅明细</h4>
                                <#list sites! as site>
                                        <div class="row"> <div class="col-md-1"></div><div class="col-md-3">${site} </div> </div>
                                </#list>
                                <br/>
                                <div class="row">
                                        <div class="col-md-1"></div>
                                        <a class="btn btn-primary col-md-3 create_order_btn">确认订单</a>
                                </div>
                                <br/>
                                <br/>
                        </div>

                </section>
        </div>
        <script>
                $(document).ready(function () {
                        $(".create_order_btn").click(function () {
                                var json = ${orderJson};
                                $.post("/api/order/create",JSON.stringify(json),function (response) {
                                        if(response.success){
                                                window.location.href="/view/order/pay?id="+response.data;
                                        }else {
                                                alert(response.message);
                                        }

                                });
                        });
                });
        </script>
        </body>

</html>